class VerifyUtils {
  static bool isPhone(String? phone) {
    if (phone == null || phone.isEmpty || phone.length < 11) {
      return false;
    }
    RegExp regExp = RegExp(r"^((13[0-9])|(14[0-9])|(15[0-9])|(16[0-9])|(17[0-9])|(18[0-9])|(19[0-9]))\d{8}$");
    return regExp.hasMatch(phone);
  }

  static bool isPassword(String? password) {
    if (password == null || password.isEmpty) {
      return false;
    }
    //密码为8~16位数字,字母,符号至少两种组合的字符
    RegExp regExp = RegExp(r"^(?![0-9]+$)(?![a-z]+$)(?![A-Z]+$)(?![,\.#%'\+\*\-:;^_`]+$)[,\.#%'\+\*\-:;^_`0-9A-Za-z]{8,16}$");
    return regExp.hasMatch(password);
  }

  static bool isCarNumber(String? carNumber) {
    if (carNumber == null || carNumber.isEmpty) {
      return false;
    }
    RegExp regExp = RegExp(r"^([京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}(([0-9]{5}[DF])|([DF]([A-HJ-NP-Z0-9])[0-9]{4})))|([京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}[A-HJ-NP-Z0-9]{4}[A-HJ-NP-Z0-9挂学警港澳]{1})$");
    return regExp.hasMatch(carNumber);
  }

  static bool isNumber(String? value) {
    if (value == null || value.isEmpty) {
      return false;
    }
    return double.tryParse(value) != null;
  }
}
